package com.example.wenmini.config;

import java.util.HashMap;

public class AjaxResult {

    public static Object success(Object data){
        HashMap<String, Object> result = new HashMap<>();
        result.put("status", 200);
        result.put("msg", "success");
        result.put("data", data);
        return result;
    }

    public static Object success(Object data, String msg){
        HashMap<String, Object> result = new HashMap<>();
        result.put("status", 200);
        result.put("msg", msg);
        result.put("data", data);
        return result;
    }

    public static Object error(Object msg){
        HashMap<String, Object> result = new HashMap<>();
        result.put("status", 500);
        result.put("msg", msg);
        result.put("data", "");
        return result;
    }

    public static Object error(Object data, String msg){
        HashMap<String, Object> result = new HashMap<>();
        result.put("status", 500);
        result.put("msg", msg);
        result.put("data", data);
        return result;
    }



}
